function cr = cr_pattern(d)
% the matrix store the indices of degree d
% much alike the function asce_pattern and desc_pattern
% the local dof index is stored in the up-right triangle.
%%%%%%%%%
%
%
rows = d+1;
cols = rows;
cr = zeros(rows,cols);
count = 1;
for line = 1:rows
    for row = line:-1:1
        cr(row,line-row+1) = count;
        count = count + 1;
    end
end
end